package ARRAY_TrinhCongDoc04;


public class model {
	public int GTMax (int a1[]){
		int GTmax = a1[0];
		for(int i =0;i<a1.length;i++){
			if(GTmax<a1[i]){
				GTmax=a1[i];
			}
		}
		return GTmax;
	}
	public int GTMin (int a1[]){
		int GTmin = a1[0];
		for(int i = 0;i<a1.length;i++){
			if(GTmin>a1[i]){
				GTmin=a1[i];
			}
		}
		return GTmin;
	}
	public int[] MangMax (int a1[],int a){
		int[] a2 = new int[a1.length];
		int b = 0;
		for(int i = 0;i<a1.length;i++){
			if(a==a1[i]){
				a2[b] = i;
				b++;
			}
		}
		int[] a3;
		a3 = new int[b];
		System.arraycopy(a2, 0, a3, 0, b);
		return a3;
	}
}